import request from '@/utils/request'

// 角色列表
export const getRoleList = (params) => {
  return request({
    method: 'get',
    url: '/system/role/query',
    params: params,
  })
}

// 新增角色
export const roleAdd = (params) => {
  return request({
    method: 'post',
    url: '/system/role/add',
    data: params,
  })
}
// 编辑角色
export const roleEdit = (pkid, params) => {
  return request({
    method: 'put',
    url: `/system/role/update/${pkid}`,
    data: params,
  })
}
// 删除角色
export const roleDelete = (params) => {
  return request({
    method: 'delete',
    url: '/system/role/delete',
    params: params,
  })
}

// 未绑定角色的用户列表
export const getNoRoleList = (params) => {
  return request({
    method: 'get',
    url: '/system/user/query/noRole',
    params: params,
  })
}

// 批量绑定用户角色
export const roleAddUser = (params) => {
  return request({
    method: 'post',
    url: '/system/role/add/rel',
    data: params,
  })
}

// 批量移除用户角色
export const roleDeleteUser = (params) => {
  return request({
    method: 'delete',
    url: '/system/role/delete/rel',
    data: params,
  })
}
